<?php
	require_once 'bbs/include/common.inc.php';	
	require_once 'customer_config.php';	
	require_once 'classes/include.php';
	require_once 'classes/pager.class.php';
	
	$id		= $_GET['id'];
	$fid	= $_GET['fid'];
	
	//获取记录总数
	$count_sql		= "select count(*) as amount from video where sort = '".$fid."'";
    $count_query	= $db->query($count_sql);
    $res_amount		= $db->fetch_array($count_query);
    $total_amount	= $res_amount['amount'];
	
	/*
	 *	翻页类使用(classes/pager.class.php)
	 *	传入总共记录数和每页显示条数
	 *	$pager->gethtml(); 		得到翻页的html代码，直接打印即可
	 *	$pager->get_limit();	拼出sql语句中的limit语句
	 *
	*/
	if( $total_amount > 0 )
	{
		$pager		= new pager( $total_amount, $pernum=12);
		$pagers		= $pager->gethtml();
		//$pager_url	= $pager->geturl();
		$limit		= $pager->get_limit();
	}	
	
	//得到视频分类
	$s_sql		= "select fid, name from topic_type where fid = '".$fid."'";
	$s_query	= $db->query($s_sql);
	$menu_info	= $db->fetch_array($s_query);
?>	

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>北京市京师律师学校</title>
<link rel="stylesheet" href="./css/base.css" type="text/css"/>
<link rel="stylesheet" href="./css/superfish.css" type="text/css"/>
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/hoverIntent.js"></script>
<script type="text/javascript" src="js/superfish.js"></script>
<script type="text/javascript">
$(function()
{
	$("#navigationMenu").superfish();
});
</script>
</head>
<body>
<div class="PageContainer">
	<? include("classes/page_header.php"); ?>
	<div class="PageContent">
		<div class="PageContentBlock PicturesMarquee Level2">
			<img src="<?=getTopicBanner($id);?>"/>
		</div>
		
		<div class="PageContentBlock SectionPath">
			<p>
				<span class="NormalText">您现在的位置：</span>
				<span class="Path">
					<?=getPath($id)?>
				</span>
			</p>
		</div>
		
		<div class="PageContentBlock TwoColumnsContainer">
			<? include("classes/page_left.php"); ?>	
			<div class="TwoColumnsContent_Right" style="line-height:22px">				
				<link rel="stylesheet" href="./css/video.css" type="text/css"/>
				<?php echo $menu_info['name']; ?>
				<div id="movies_lists" class="main-wrap">
					<div monkey="top3" class=" mod videos-mod">
					
						<table border="0" width="98%" align="center">
							<tr>
							<?php 
								$sql = "select * from video where sort = '".$fid."' limit ".$limit;
								$query = $db->query($sql);
								$i = 1;
								while($video_info = $db->fetch_array($query)) {
									$i++;
							?>
								<td>
								
								
								<table border="0">
						<tr>
							<td>
				<a statisic="toplay" title="<?php echo $video_info['title']?>" target="_blank" href="topic.php?id=<?php echo $id;?>&video_id=<?php echo $video_info['id']; ?>" class="hd"><img width="114" height="152" src="./images/lv2imagelinks/01.png"><span class="play"></span></a>
							</td>
						</tr>
						<tr><td><a statisic="toplay" target="_blank" href="topic.php?id=<?php echo $id;?>&video_id=<?php echo $video_info['id']; ?>" title="<?php echo $video_info['title']?>" class="wbr"><?php echo $video_info['title']?></a></td></tr>
						<tr><td align="center"><?php 
										if($video_info['deduct_scores'] == 0){ 
											echo '<div>不需要积分</div>';
										}else{
											echo '<div>所需积分：'.$video_info['deduct_scores'].'</div>';
										}
									?></td></tr>
					</table>
								
								
								
								</td>
							<?php 
									if($i % 4 == 1){
										echo "</tr><tr>";
									}
							} ?>
							</tr>
						</table>
					
					
						<?php
						echo '<div style="text-align:center">'.$pagers.'</div>';
						?>
					</div>
				</div>
			</div>
		</div>		
	</div>
	<? include("classes/page_footer.php"); ?>	
</div>
</body>
</html>
